﻿<%@ Page Title="Sign Up - Savory Housing" Language="C#" MasterPageFile="~/RealState.Master" AutoEventWireup="true"
    CodeBehind="NonMemberShip.aspx.cs" Inherits="WebApplication.NonMemberShip" enableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
       <script src="Scripts/Registration.js" type="text/javascript"></script>
    <script src="Scripts/Common.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#<%=ddlCity.ClientID%>').attr("disabled", true);
            $('#<%=ddlCountry.ClientID%>').change(getCity);
            $('#<%=ddlCountry.ClientID%>').change(getCountryCode);
            $('#<%=ddlCity.ClientID%>').append(new Option('City', 'City', false));
            $(":input[title]").each(function () {
                $(this).val($(this).attr("title"));
                $(this).bind('focus', function () {
                    if ($(this).val() == $(this).attr("title")) $(this).val('');
                });
                $(this).bind('blur', function () {
                    if ($(this).val() == '') $(this).val($(this).attr("title"));

                });
            });

            $('#<%=txtPassword.ClientID %>').focusin(function () {
                $('#<%=txtPassword.ClientID %>')[0].type = "Password";
            });
            $('#<%=txtConfirmaPassword.ClientID %>').focusin(function () {
                $('#<%=txtConfirmaPassword.ClientID %>')[0].type = "Password";
            });

        });

        function getCity() {
            $('#<%=ddlCity.ClientID%>').attr("disabled", true);
            $("select[id$=ddlCity] > option").remove();
            $('#<%=ddlCity.ClientID%>').append(new Option('City', 'City', false));
            $.ajax({
                type: "POST",
                url: "/CountryService.asmx/GetCity",
                data: "{Country: '" + $('#MainContent_ddlCountry').val() + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                    for (var i = 0; i < models.length; i++) {
                        var val = models[i];
                        var text = models[i];
                        $('#MainContent_ddlCity').append(new Option(text, val, false));
                    }
                    $('#<%=ddlCity.ClientID%>').attr("disabled", false);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }

            });
        }
        function getCountryCode() {
            $.ajax({
                type: "POST",
                url: "/CountryService.asmx/GetCountryCode",
                data: "{Country: '" + $('#MainContent_ddlCountry').val() + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var objectvalue = jQuery.parseJSON(response.d);
                    $('#MainContent_txtCountryCodes').val('00' + objectvalue);

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }

            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
      <asp:HiddenField ID="hdnAlertCounter" runat="server" />
    <div class="left">
        <div class="formBlock">
            <h3 class="blue">It is Free</h3>
            <!--  Error Messages Start -->
    <%--        <div>
                <asp:CompareValidator ID="CompareValidator1" runat="server" CssClass="error" ErrorMessage="Confirm password is not same as Password" ControlToValidate="txtConfirmaPassword" ControlToCompare="txtPassword"></asp:CompareValidator>
                <asp:RequiredFieldValidator ID="reqtxtPassword" runat="server" CssClass="error" ControlToValidate="txtPassword" InitialValue="Password" ErrorMessage="Please enter Password"></asp:RequiredFieldValidator>
                <asp:CompareValidator ID="compConfirmEmailID" runat="server" ErrorMessage="Email doesn't matched" ControlToValidate="txtConfirmEmailID" CssClass="error" ControlToCompare="txtEmailID"></asp:CompareValidator>
                <asp:RegularExpressionValidator ID="regtxtEmailID" ErrorMessage="Please enter valid Email ID" runat="server" ValidationExpression="\w+([-+.&#039;]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" CssClass="error" ControlToValidate="txtEmailID"></asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator ID="reqtxtContactNumber1" runat="server" CssClass="error" InitialValue="Mobile[1]" ControlToValidate="txtContactNumber1" ErrorMessage="Please enter mobile number"></asp:RequiredFieldValidator>
                <asp:RequiredFieldValidator ID="reqddlCity" runat="server" CssClass="error" InitialValue="City" ControlToValidate="ddlCity" ErrorMessage="Please select City"></asp:RequiredFieldValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="error" InitialValue="Country" ControlToValidate="ddlCountry" ErrorMessage="Please select country"></asp:RequiredFieldValidator>
                <asp:RequiredFieldValidator ID="reqtxtLastName" runat="server" CssClass="error" InitialValue="Last Name" ControlToValidate="txtLastName" ErrorMessage="Please enter last name"></asp:RequiredFieldValidator>
                <asp:RequiredFieldValidator ID="reqtxtFirstName" runat="server" CssClass="error" InitialValue="First Name" ControlToValidate="txtFirstName" ErrorMessage="Please enter first name"></asp:RequiredFieldValidator>
            </div>--%>
            <!--  Error Messages Start -->
            <dl class="form clearfix">
                <dt>
                    <asp:TextBox ID="txtFirstName" CssClass="form-text" title="First Name" MaxLength="200"
                        runat="server" TabIndex="1" /> <span class="red">*</span> 
                </dt>
                <dt>
                    <asp:TextBox ID="txtLastName" CssClass="form-text" title="Last Name" MaxLength="100"
                        runat="server" TabIndex="2" /> <span class="red">*</span> 
                </dt>
                <dt>
                    <asp:DropDownList ID="ddlCountry" CssClass="form-text" runat="server" TabIndex="3"></asp:DropDownList>
                     <span class="red">*</span> 
                </dt>
                <dt>
                    <asp:DropDownList ID="ddlCity" CssClass="form-text" runat="server" TabIndex="4"></asp:DropDownList>
                     <span class="red">*</span> 
                    <br />
                </dt>
                 <dt>
                    <asp:TextBox ID="txtCountryCodes" CssClass="form-text" title="Country Code" MaxLength="100" runat="server" TabIndex="5" ReadOnly="true" />
                </dt>

                <dt>
                    <asp:TextBox ID="txtContactNumber1" CssClass="form-text" title="Mobile[1]" MaxLength="100"
                        runat="server" TabIndex="6" />
                </dt>
                <dt>
                    <asp:TextBox ID="txtContactNumber2" CssClass="form-text" title="Mobile[2]" MaxLength="100" runat="server" TabIndex="7" />
                </dt>
                <dt>
                    <asp:TextBox ID="txtEmailID" CssClass="form-text" title="Your Email" MaxLength="200" runat="server" TabIndex="8" />
                     <span class="red">*</span> 
                </dt>
                <dt>
                    <asp:TextBox ID="txtConfirmEmailID" CssClass="form-text" title="Confirm Email" MaxLength="200" runat="server" TabIndex="9" />
                     <span class="red">*</span> 
                </dt>
                <dt>
                    <asp:TextBox ID="txtPassword" CssClass="form-text" MaxLength="20" runat="server" TabIndex="10" title="Password" />
                     <span class="red">*</span> 
                </dt>
                <dt>
                    <asp:TextBox ID="txtConfirmaPassword" CssClass="form-text" MaxLength="20" runat="server" TabIndex="11" title="Confirm Password" />
                     <span class="red">*</span> 
                </dt>
                <dt>
                    <label>
                        <asp:CheckBox ID="chkNewsLatter" runat="server" TabIndex="12" />
                        <span class="blue">Send me Special Offers, Events and News-Letters.</span></label>
                    <br />
                    <a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'" class="lnk_purple">Why do you need to provide this information?</a><br />
                    </dt>
                    <div id="light" class="popup_content" style="display:none;">
                           <div class="popup_container">
                           <div class="popup_msg">
                            <h2>Why do you need to provide this information?</h2>
                            <p>Aug 9, 2012 - Rather than using a bloated plugin that has features you'll never use, 
                            this tutorial shows you how to create a super simple lightbox for handling ...
                            You visited this page on 20/7/13.</p>
                            <ul>
                                <li>In this example everything is static</li>
                                <li>Hope you will find it useful, should you use</li>
                                <li>Template Monster offers you a great assortment of CSS Templates</li>
                            </ul>
                            </div>
                            <div class="popup_ok"><input type="button" value="Ok, I got it" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'" /></div>
                           </div>
                    </div>
                <dt>
                    <br />
                    <asp:Button ID="btnSubmit" runat="server" CssClass="reg-blue-round-btn w75" TabIndex="13"
                        OnClick="btnSubmit_Click" Text="Sign Up" />
                    <asp:Label ID="lblMessage" Visible="false" runat="server" />
                </dt>
            </dl>
        </div>
    </div>
    </div>
</asp:Content>
